package hmis.pos.Entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import hmis.pos.Base.BaseEntity.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Table(name="roomorder")
public class Order extends BaseEntity {

    //员工姓名
    @Column(name="username")
    private String username;

    //申请人姓名，非空
    @Column(name="applicant",nullable = false)
    private String applicant;

    //申请人电话号码
    @Column(name="phone",nullable = false)
    private String phone;

    //入住时间，非空
    @Column(name="in_time",nullable = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date in_time;

    //离开时间，非空
    @Column(name="out_time",nullable = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date out_time;

    //订单创建时间，非空
    @Column(name="create_time",nullable = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    private Date create_time;

    //订单状态，非空
    @Column(name="status",nullable = false)
    private String status;

    //订单总金额，非空
    @Column(name="total",nullable = false)
    private double total;

    //支付方式
    @Column(name="pay_method")
    private String pay_method;

    // 实收金额
    @Column(name="pay_amount",nullable = false)
    private double pay_amount;

    // 付款时间
    @Column(name="pay_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    private Date pay_time;

    public String getApplicant() {
        return applicant;
    }

    public void setApplicant(String applicant) {
        this.applicant = applicant;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Date getIn_time() {
        return in_time;
    }

    public void setIn_time(Date in_time) {
        this.in_time = in_time;
    }

    public Date getOut_time() {
        return out_time;
    }

    public void setOut_time(Date out_time) {
        this.out_time = out_time;
    }

    public Date getCreate_time() {
        return create_time;
    }

    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public double getTotal() {
        return total;
    }

    public void setTotal(double total) {
        this.total = total;
    }

    public String getPay_method() {
        return pay_method;
    }

    public void setPay_method(String pay_method) {
        this.pay_method = pay_method;
    }

    public double getPay_amount() {
        return pay_amount;
    }

    public void setPay_amount(double pay_amount) {
        this.pay_amount = pay_amount;
    }

    public Date getPay_time() {
        return pay_time;
    }

    public void setPay_timet(Date pay_time) {
        this.pay_time = pay_time;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPay_time(Date pay_time) {
        this.pay_time = pay_time;
    }

    @Override
    public String toString() {
        return "Order{" +
                "username='" + username + '\'' +
                ", applicant='" + applicant + '\'' +
                ", phone='" + phone + '\'' +
                ", in_time=" + in_time +
                ", out_time=" + out_time +
                ", create_time=" + create_time +
                ", status='" + status + '\'' +
                ", total=" + total +
                ", pay_method='" + pay_method + '\'' +
                ", pay_amount=" + pay_amount +
                ", pay_time=" + pay_time +
                '}';
    }
}
